home *** CD-ROM | disk | FTP | other *** search
- Path: keats.ugrad.cs.ubc.ca!not-for-mail
- From: c2a192@ugrad.cs.ubc.ca (Kazimir Kylheku)
- Newsgroups: comp.lang.perl.misc,comp.lang.c
- Subject: Re: PROGRAMERS OF ANY LANGUAGE
- Date: 14 Apr 1996 14:40:28 -0700
- Organization: Computer Science, University of B.C., Vancouver, B.C., Canada
- Message-ID: <4krrccINN78i@keats.ugrad.cs.ubc.ca>
- References: <Pine.SOL.3.91.960329010021.13209A-100000@harvey> <4kqe6q$1tm@innocence.interface-business.de> <4kr869INN35k@keats.ugrad.cs.ubc.ca> <4krg5h$7tt@nntp1.best.com>
- NNTP-Posting-Host: keats.ugrad.cs.ubc.ca
-
- In article <4krg5h$7tt@nntp1.best.com>, Zenin <zenin@best.com> wrote:
- >Kazimir Kylheku <c2a192@ugrad.cs.ubc.ca> wrote:
- > >snip<
- >: The programmer is forced to ``disambiguate'':
- >: if (....) {
- >: if (....) {
- >: if (....) {
- >: statement;
- >: }
- >: }
- >: } else {
- >: statement;
- >: }
- >: What a PITA. (And I ain't referring to an Italian meal also known as a pizza
- >: pocket, either).
- >
- > You don't program much, do you? :)
-
- Actually I do program much. I wouldn't talk if I were you, read on...
-
- > if( ... && ... && ... ) {
- > statement;
- > } else {
- > statement;
- > }
-
- In your if statement, the else clause gets executed if *any one* of the
- test expressions fails! ``if (1 && 1 && 0)'' will launch into the *else* clause.
-
- In MY if statement, the else clause only gets executed it the *outermost* test
- condition fails. ``if (1) if (1) if (0) statement 1; else statement2;'' will
- cause *neither* statement1 *nor* statement2 to be executed!
-
- See, the two are not equivalent at all!
-
- Who is it who doesn't program much?
-
- ... and I still think Perl's handling of the classic if/then ambiguity during
- LR parsing is a lame copout. But I like it very much otherwise...
-